<?php
//    include("init.php");
    $id = $_GET["id"];
//    function GameList(){
//        return array("苹果","梨子","再接再厉","橘子","红龙果","再接再厉","车厘子","再接再厉","柚子","西瓜","再接再厉","1000元","再接再厉","10元","520元","1314元","1314520元","10元","10元","10元","再接再厉");
//    };
    function dataList(){
      return 
          array(
              array("type"=>1,"image"=>"img/red-jh.png","name"=>"张三丰","price"=>"500","id"=>"123"),
              array("type"=>1,"image"=>"img/red-jh.png","name"=>"张三","price"=>"8900","id"=>"23"),
              array("type"=>1,"image"=>"img/red-jh.png","name"=>"李三丰","price"=>"5000","id"=>"73"),
              array("type"=>1,"image"=>"img/red-jh.png","name"=>"赵四丰","price"=>"800","id"=>"33"),
              array("type"=>1,"image"=>"img/red-jh.png","name"=>"钱三丰","price"=>"400","id"=>"33"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"赵敏","price"=>"87","id"=>"12"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"周芷若","price"=>"167","id"=>"22"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"小昭","price"=>"348","id"=>"56"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"小龙女","price"=>"3453","id"=>"89"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"刘亦菲","price"=>"9002","id"=>"93"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"刘亦菲送个汤唯","price"=>"91002","id"=>"93"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"刘亦菲送个汤唯","price"=>"90042","id"=>"935"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"刘亦菲送个汤唯","price"=>"90032","id"=>"923"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"刘亦菲送个汤唯","price"=>"90302","id"=>"930"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"刘亦菲送个汤唯","price"=>"90032","id"=>"931"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"刘亦菲送个汤唯","price"=>"94002","id"=>"913"),
              array("type"=>2,"image"=>"img/red-jh.png","name"=>"刘亦菲送个汤唯","price"=>"90502","id"=>"9113")
          );
    };
    function getRandom($random){
        $n = rand(0,$random);
        return $n;
    };
    $arr = dataList();
    $res = getRandom(count($arr)-1);
    echo ($id==1)?json_encode($arr):$res;
    ?>

